# -*- sh -*-

out=$Here/doc/${1%.*}.html

cat<<EOF> $out
<html><head><title>$1</title>
<link rel="stylesheet" href="base.css">
<link rel="stylesheet" href="print.css"  media="print">
<link rel="stylesheet" href="screen.css" media="screen">
</head>
<body>
EOF

(cat $1 $Here/etc/copyright.txt | 
$Gawk -f $Here/etc/indent.awk |
multimarkdown
echo "</body></html>" ) |
$Gawk -f $Here/etc/highlight.awk >> $out

cd $Here/doc
cp $Here/etc/*.css .
[ -f "*.css" ] && svn propset svn:mime-type text/css *.css
[ -f "*.html" ] && svn propset svn:mime-type text/html *.html
[ -f "*.png" ] && svn propset svn:mime-type image/x-png *.png
[ -f "*.gif" ] && svn propset svn:mime-type image/gif *.gif
[ -f "*.jpg" ] && svn propset svn:mime-type image/jpeg *.jpg


